#include"udpServer.hpp"

int main(int argc, char* argv[])
{
    if (argc != 2) 
    {
        std::cerr << "usage : " << argv[0] << "loclaport" << std::endl;
        die(usage_error);
    }
    // std::string ip = argv[1];
    uint16_t port = std::stoi(argv[1]);
    LogMudule::ENABLE_CONSOLE_LOG();
    std::shared_ptr<dict> dict_sptr = std::make_shared<dict>();
    std::unique_ptr<udpServer> svr_uptr = std::make_unique<udpServer>([&dict_sptr](const std::string&word){
        return dict_sptr->translate(word);
    }, port);
    svr_uptr->initServer();
    svr_uptr->start();
    return 0;
}